package com.shop.front.dao.user;

import com.shop.domain.user.Collect;
import com.shop.jpa.BaseDao;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface CollectDao extends BaseDao<Collect, Long> {

    @Query(nativeQuery = true, value = "select count(*) from t_collect where user_id =?1  and is_deleted = 0")
    Integer myCollectCount(Long userId);

    Collect queryCollectByUserIdAndProductId(Long userId ,Long productId);
}
